﻿using AutoMapper;
using XsqTech.SmartOA.Domain.Table;
using XsqTech.SmartOA.Dtos.DTO;
using XsqTech.SmartOA.Dtos.XSPDto.FormDto;
using XsqTech.SmartOA.Dtos.XSPDto.FromDto;
using XsqTech.SmartOA.Service.DTO;

namespace XsqTech.SmartOA.Service.ConfigAutoMapper
{
    public class configAutoMapper:Profile
    {
        /// <summary>
        /// AutoMapper实体映射
        /// </summary>
        public configAutoMapper()
        {
            //←左为要装换的数据类型，→右边是转换后的数据类型
            //CreateMap<GooodsModer,Models>();//创建实体到Dto的映射
            //CreateMap<GooodsModer, Models>().ReverseMap();//双向转换
            CreateMap<AddUserDto, User>(); 
            CreateMap<UserRoleDto, UserRole>();
            CreateMap<PermissionDto, Permission>();
            CreateMap<AddFromDto, Form>();
            CreateMap<Roles, RolesInputDto>();
            CreateMap< RolesInputDto, Roles>();
            CreateMap<MenuDto, Menu>();
            CreateMap<UptDepartmentsDto, Department>();
            CreateMap<TimingDto, Timing>();
        }
    }
}